@model Adams.Admin.DataTransfer.Console.CreateUser.PageLoad
@{
    Layout = "~/Views/Console/_LayoutAdmin.cshtml";
}
@if (!string.IsNullOrEmpty(ViewBag.Message))
    {
    <div class="notification success png_bg">
        <a href="#" class="close">
            <img src="@Url.Content("/Content/images/cross_grey_small.png")" title="Close this notification"
            alt="close" /></a>
        <div>
            @if (ViewBag.Message == "1")
            {
                <b>Successfully saved User!</b>
            }
        </div>
    </div>
    }
<div class="content-box">
    <!-- Start Content Box -->
    <div class="content-box-header">
        <h3>
            Your Information</h3>
    </div>
    <!-- End .content-box-header -->
    <div class="content-box-content">
        <form action="" method="post">
        <p>
            <label>
                First Name</label>
            <input class="text-input medium-input" type="text" id="FirstName" value="@Model.User.FirstName" />
            <br />
            <small></small>
        </p>
        <p>
            <label>
                Last Name</label>
            <input class="text-input medium-input" type="text" id="LastName" value="@Model.User.LastName" />
            <br />
            <small></small>
        </p>
        <p>
            <label>
                Email</label>
            <input class="text-input medium-input" type="text" id="Email" value="@Model.User.Email" />
            <br />
            <small></small>
        </p>
        <p>
            <label>
                Password</label>
            <input class="text-input medium-input" type="password" id="Password" value="" />
            <br />
            @if (@Model.User.ID > 0)
            {
                <small>leave empty to not change</small>
            }
        </p>
        <p>
            <label>
                Status</label>
            <input type="checkbox" id="IsActive" @(Model.User.IsActive ? "checked" : "") /> Active
            <input type="checkbox" id="IsLocked" @(Model.User.IsLocked ? "checked" : "") /> Locked
            <small></small>
        </p>
        <p>
            <label>
                Permissions</label>
            @foreach (var app in Model.Applications)
            {
                <input type="checkbox" name="Applications" value="@app.ID" @(Model.User.Applications.Exists(a => a.ID == app.ID) ? "checked" : "") />@app.Name <br />
            }
            <br />
            <small></small>
        </p>
        <p>
            <input class="button" id="submit" type="button" value="Submit" />
        </p>
        <div class="clear">
        </div>
        <!-- End .clear -->
        <input id="id" type="hidden" value="@Model.User.ID" />
        </form>
    </div>
    <!-- End .content-box-content -->
</div>
<!-- End .content-box -->
@section Scripts {
    <script type="text/javascript" src="@Url.Content("/Scripts/Console/createuser.js")"></script>
}
